{extends file='layout/admin.html'}

{block name='title'}Manage Administrative Users - Intel Sales Advisor{/block}

{block name='content'}

<h1>Manage Administrative Users</h1>
<h2 class="pb10">Set Tags: {$info.user_name}</h2>
<div class="clearfix sub_nav"><span class="btn fr"><a href="admin/admin_manage.html">Cancel</a></span><span class="btn fr"><a href="#" class="save">Save</a></span></div>
<form action="admin/admin_manage/set_tags/{$info.id}.html" method="post" accept-charset="utf-8">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="content_table">
	<thead>
		<tr style="height: 10px">
			<th class="left" style="width: 5%;"><input type="checkbox" id="ck_all" /></th>
			<th style="border-left: 1px solid #CCC; width: 50%;">Tag</th>
			<th style="border-left: 1px solid #CCC; width: 45%;" class="right">Category</th>
		</tr>
	</thead>
	<tbody class="text_indent">
	  {$i=1}
	  {foreach $tags as $val}
	   {if $val.parent_id}
	    {if $i % 2}<tr>{else}<tr class="odd">{/if}
  	  	<td style="text-align: center;"><input type="checkbox" name="tags[]" value="{$val.id}"{if in_array($val.id, $info.tags)} checked{/if} /></td>
  			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{$val.tag_name}</td>
  			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{$tags[$val.parent_id]['tag_name']}</td>
  		</tr>
  		{$i=$i+1}
  		{/if}
	  {/foreach}
	</tbody>
</table>
</form>
<div class="clearfix sub_nav">
	<span class="btn fr"><a href="admin/admin_manage.html">Cancel</a></span><span class="btn fr"><a href="#" class="save">Save</a></span>
</div>
<script type="text/javascript" charset="utf-8">
$('a.save').click(function(){
  $('form').submit();
  return false;
});
$('#ck_all').click(function(){
  $('input[name=tags[]]').attr('checked', $(this).attr('checked'));
});
</script>
{/block}